@extends('layouts.back_stage')
@section('content')
    <style>
        .form_ul{width:100%;height:auto;margin-bottom:20px;}
        .form_li{width:380px;height:180px;margin:0 30px 30px 0;float:left;font-size:14px;background:#fff;box-shadow:0 5px 15px 0 #ddd;position:relative;}
        .lis_p{padding:20px 20px;margin-bottom:0;}
        .lis_div{padding:0 20px;}
        .lis_a{position: absolute;right:20px;bottom:20px;}
        .form_div{width:380px;height:180px;line-height:180px;text-align:center;font-size:20px;}
    </style>
    <div class="container">
        <div style="padding:20px 0;"><h3>提交工单</h3></div>
        <div style="width:90%;margin-left:35px;">
            <div class="form-group"><h3 >请选择问题类型</h3></div>
            <div class="form-group">
                <ul class="form_ul">
                    <li class="form_li">
                        <p class="lis_p">
                            <i class="fa fa-clone"></i>
                            <span>客户退换货</span>
                        </p>
                        <div class="lis_div">商品质量、客户不满意等相关问题</div>
                        <a class="lis_a" href="javascript:;">提交工单</a>
                    </li>
                    <li class="form_li">
                        <div class="form_div">敬请期待</div>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    <script>
        $(".lis_a").click(function(){
            $.ajax({
                url:'/work-order/increase',
                type:'post',
                data:{},
                headers: {
                    'X-CSRF-TOKEN': $('meta[name="csrf_token"]').attr('content')
                },
                dataType:'json',
                success:function(data){
                    if(data.success){
                        window.location.href='/work-order/work-order-increase?type=1&id='+data.msg.id;
                    }else{
                        $(".faceImg").attr("src","/img/weep.png");
                        $(".oHandle").text(data.msg);
                        $(".oSuccess").show(0).delay(1000).hide(0);
                    }
                }
            })
        });
        window.onload=function(){
            var url = window.location.href;
            if(url.indexOf("tn=1") >= 0 ) {
                $(".order_li").addClass('active').siblings().removeClass('active');
                $(".order_li").children('.nav-second-level').addClass('in').parent().siblings().children('.nav-second-level').removeClass('in');
            }
            var num=$(".order_li.item-li").index();
            sessionStorage.setItem('Number',num);
        }

    </script>
@endsection